from .de import DE
from .pso import PSO
from .ga import GA
from .rl_de import RLDE

class OptimizerFactory:
    @staticmethod
    def create_optimizer(optimizer_type, **kwargs):
        """
        创建优化器实例
        
        参数:
            optimizer_type: 优化器类型 ('de', 'pso', 'ga', 'rl_de')
            **kwargs: 优化器参数
        """
        optimizers = {
            'de': DE,
            'pso': PSO,
            'ga': GA,
            'rl_de': RLDE
        }
        
        if optimizer_type not in optimizers:
            raise ValueError(f"不支持的优化器类型: {optimizer_type}")
            
        return optimizers[optimizer_type](**kwargs) 